import request from './Request';

export default class UserWorks {
    static unLike(id) {
        return request({
            url: '/user/works/unLike',
            method: 'get',
            params: {
                id,
            }
        });
    }

    static like(id) {
        return request({
            url: '/user/works/like',
            method: 'get',
            params: {
                id,
            }
        });
    }

    // 新增
    static save(data) {
        return request({
            url: '/user/works/save',
            method: 'post',
            data: data,
        });
    }

    // 返回所有数据
    static list(param) {
        return request({
            url: `/user/works/list`,
            method: 'get',
            params: {
                ...param,
            }
        });
    }

    // 新增删除接口
    static delete(id) {
        return request({
            url: `/user/works/delete/${id}`,
            method: 'delete'
        });
    }

    static selfIdList(param) {
        return request({
            url: `/user/works/selfId/list`,
            method: 'get',
            params: {
                ...param,
            }
        });
    }

    // 算法获取列表
    static getRecommendedWorks() {
        return request({
            url: '/recommend/works',
            method: 'get'
        });
    }
}    